package com.miao.im.common;

import cn.hutool.core.util.IdUtil;
import com.miao.im.support.util.MachineIdUtil;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/3/1 10:00
 * @Description:
 */
public class Constant {
    /**web端用的session header*/
    public static final String WEB_SESSION_HEADER = "web_sessionId";
    public static final String WEB_DEVICE_NUMBER_HEADER = "web_deviceNumber";
    public static final int APP_VERSION = 1;
    /**消息协议头长度*/
    public static final int HEADER_LENGTH = 28;
    /**消息分发器交换机名称*/
    public static final String DISPATCHER_EXCHANGE = "dispatcherTopic";
    /**分发器队列名称*/
    public static final String DISPATCHER_QUEUE_NAME = "dispatcherQueue." + MachineIdUtil.encryptLocalMachineId();
    /**用于广播的队列名称*/
    public static final String DISPATCHER_BROADCAST_QUEUE_NAME = "dispatcherBroadcastQueue." + MachineIdUtil.encryptLocalMachineId();
    /**分发器routing key 名称*/
    public static final String DISPATCHER_ROUTING_KEY_PREFIX = "dispatcherRouting.";
    public static final String DISPATCHER_ROUTING_KEY_NAME = DISPATCHER_ROUTING_KEY_PREFIX + IdUtil.simpleUUID();
    /**用于广播的队列*/
    public static final String DISPATCHER_BROADCAST_ROUTING_KEY_NAME = DISPATCHER_ROUTING_KEY_PREFIX + "broadcast";
    /**标记服务器已启动*/
    public static volatile boolean SERVER_ACTIVE = false;
}
